package com.tedu.springdemo.day04;


import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;


//实例工厂    方法：返回值  返回对象
//@Bean注解    用于方法上，返回对象
@Component
public class NetConnInstanceFactory {
    @Bean("nc")
    public  NetConnection getInstance(){
        NetConnection nc=new NetConnection();
        nc.load();nc.ping();nc.conn();
        return nc;
    }
}